#include <header.h>

int main(){

    int fd_r = open("1.pipe", O_RDONLY);
    int fd_w = open("2.pipe", O_WRONLY);
    
    while(1){

        char buf[100]= {0};
        read(fd_r, buf, sizeof(buf));
        printf("a: %s ", buf);

        bzero(buf, sizeof(buf));
        read(STDIN_FILENO, buf, sizeof(buf));
        write(fd_w, buf, sizeof(buf));
    }

    close(fd_r);
    close(fd_w);
    return 0;
}

